<extend name="base" />

<block name="style">
<style type="text/css">
.main_info table tr:hover{background-color:rgb(240,245,250);}
.main_info table tr:nth-child(2n){background-color:rgb(245,246,250);}
a{color:#369;} a:hover{color:#69F}
</style>
</block>
<block name="md_title">
	<div class="title">用户管理</div>
    <button class="buttonB">刷新</button>
    <button class="buttonA">添加</button>
</block>

<block name="main_cont">
	<table class="table_user_auth">
    	<thead><tr><th>UserId</th><th>昵称</th><th>用户名</th><th>登陆次数</th><th>最后登录时间</th><th>最后登录IP</th><th>状态</th><th>操作</th></tr></thead>
    	<foreach name="userlist" item="value">
        <tr><td>{$value.userid}</td><td>{$value.nickname}</td><td>{$value.username}</td><td>{$value.logincount}</td><td>{$value.lastdate|date="Y-m-d",###}</td>
        	<td>{$value.lastip}</td><td><if condition="($value.valid eq 1)">正常<else/>禁用</if></td>
            <td>
            	<a href="index?func=changeValid&userid={$value.userid}&valid={$value.valid}"><if condition="($value.valid eq 1)">禁用<else/>启用</if></a> 
            	<a href="index?func=userGroup&userid={$value.userid}">授权</a> 
            	<a href="index?func=deleteUser&userid={$value.userid}">删除</a> 
            	<a href="index?func=recoverPwd&userid={$value.userid}">重置密码</a>
            </td></tr>
        </foreach>
    </table>
</block>

<block name="script">
<script src="__ROOT__/Public/Js/jquery.tablesorter.js"></script>
<script src="__ROOT__/Public/Js/jquery.tablesorter.widgets.js"></script>
<script language="javascript">
$(function(){
	$('.table_user_auth').tablesorter({
		widgets        : ['zebra', 'columns'],
		usNumberFormat : false,
		sortReset      : true,
		sortRestart    : true
	});
});
</script>
</block>